import type { AppRouteModule } from '/@/router/types';
import { getParentLayout, LAYOUT } from '/@/router/constant';
const workFlow: AppRouteModule = {
  path: '/workFlowManage',
  name: 'WorkFlowManage',
  component: LAYOUT,
  redirect: '/workFlowManage/workFlow/processManagement',
  meta: {
    icon: 'ion:menu-outline',
    title: '工作流管理',
    orderNo: 14,
  },

  children: [
    {
      path: 'workFlow',
      name: 'WorkFlow',
      component: getParentLayout('WorkFlow'),
      meta: {
        title: '流程管理',
      },
      redirect: '/workFlowManage/workFlow/processManagement',
      children: [
        {
          path: 'processManagement',
          name: 'ProcessManagement',
          component: () => import('/@/views/backs/workFlowManage/processManagement/index.vue'),
          meta: {
            title: '流程表单',
          },
        },
        {
          path: 'modelEdit/:id',
          component: () => import('/@/views/backs/workFlowManage/processManagement/model/edit/index.vue'),
          name: 'ModelEdit',
          meta: {
            hideMenu: true,
            title: '设计流程',
            currentActiveMenu: '/workFlowManage/workFlow/processManagement',
          },
        },
        {
          path: 'processModel',
          name: 'ProcessModelPage',
          component: () => import('/@/views/backs/workFlowManage/processModel/index.vue'),
          meta: {
            title: '流程模型',
          },
        },
        {
          path: 'modelDesign/:id',
          name: 'ModelDesignPage',
          component: () => import('/@/views/backs/workFlowManage/processModel/modelDesign/index.vue'),
          meta: {
            // affix: true,
            title: '设计模型',
            hideMenu: true,
            currentActiveMenu: '/workFlowManage/workFlow/processModel',
          },
        },
        {
          path: 'modelAllocation/:id',
          name: 'ModelAllocation',
          component: () => import('/@/views/backs/workFlowManage/processModel/modelAllocation/index.vue'),
          meta: {
            // affix: true,
            title: '分配流程',
            hideMenu: true,
            currentActiveMenu: '/workFlowManage/workFlow/processModel',
            ignoreKeepAlive: true,
          },
        },
        {
          path: 'modelDefine/:id',
          name: 'ModelDefine',
          component: () => import('/@/views/backs/workFlowManage/processModel/modelDefine/index.vue'),
          meta: {
            // affix: true,
            title: '流程定义',//菜单名
            hideMenu: true,//当前路由不再菜单显示
            currentActiveMenu: '/workFlowManage/workFlow/processModel',//hideMenu为true；当前激活的菜单。用于配置详情页时左侧激活的菜单路径
            ignoreKeepAlive: true,// 是否忽略KeepAlive缓存
            hideTab:true,//当前路由不再标签页显示
          },
        },
        {
          path: 'processUserGroup',
          name: 'ProcessUserGroupPage',
          component: () => import('/@/views/backs/workFlowManage/processUserGroup/index.vue'),
          meta: {
            title: '用户分组',
          },
        },
      ],
    },
    {
      path: 'task',
      name: 'task',
      component: getParentLayout('WorkFlow'),
      meta: {
        title: '任务管理',
      },
      redirect: '/workFlowManage/taskManagement/index',
      children: [
        {
          path: 'taskManagement',
          name: 'TaskManagementPage',
          component: () => import('/@/views/backs/workFlowManage/taskManagement/index.vue'),
          meta: {
            title: '我的流程',
          },
        },
        {
          path: 'create',
          component: () =>
            import('/@/views/backs/workFlowManage/taskManagement/components/create/index.vue'),
          name: 'BpmProcessInstanceCreate',
          meta: {
            hideMenu: true,
            title: '发起流程',
            currentActiveMenu: '/workFlowManage/task/taskManagement',
          },
        },
        {
          path: 'detail/:id',
          component: () =>
            import('/@/views/backs/workFlowManage/taskManagement/components/detail/index.vue'),
          name: 'BpmProcessInstanceDetail',
          meta: {
            hideMenu: true,
            title: '流程详情',
            currentActiveMenu: '/workFlowManage/task/taskManagement',
          },
        },
        {
          path: 'taskTodo',
          name: 'TaskTodoPage',
          component: () => import('/@/views/backs/workFlowManage/taskTodo/index.vue'),
          meta: {
            title: '待办任务',
          },
        },
        {
          path: 'taskDone',
          name: 'TaskDonePage',
          component: () => import('/@/views/backs/workFlowManage/taskDone/index.vue'),
          meta: {
            title: '已办任务',
          },
        },
      ],
    },
    {
      path: 'operationFlow',
      name: 'OperationFlow',
      component: getParentLayout('WorkFlow'),
      meta: {
        title: '业务流程',
      },
      redirect: '/workFlowManage/operationFlow/operationFlow/index',
      children: [
        {
          path: 'project',
          name: 'Project',
          component: () => import('/@/views/backs/workFlowManage/operationFlow/project/index.vue'),
          meta: {
            title: '项目立项',
          },
        },
        {
          path: 'projectCreate',
          name: 'ProjectCreate',
          component: () =>
            import('/@/views/backs/workFlowManage/operationFlow/project/projectCreate/index.vue'),
          meta: {
            hideMenu: true,
            title: '发起项目立项',
            currentActiveMenu: '/workFlowManage/operationFlow/project',
          },
        },
        {
          path: 'projectDetail/:id',
          name: 'ProjectDetail',
          component: () =>
            import('/@/views/backs/workFlowManage/operationFlow/project/projectDetail/index.vue'),
          meta: {
            hideMenu: true,
            title: '查看项目立项',
            currentActiveMenu: '/workFlowManage/operationFlow/project',
          },
        },
      ],
    },
  ],
};

export default workFlow;
